/*
 *  Blazon: A user datagram protocol re-braodcasting daemon.
 *  io.h: Header file for io.c
 *
 *  Copyright 2012 Blazon development team
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef INCLUDED_io_h
#define INCLUDED_io_h

#include "hash.h"

/* 256 adds space for any possible sockaddr_in6 addresses present.
 * sizeof(struct sockaddr_in6) * 8 = 224
 */
#define BUFLEN	65535

/* Number of times the IO functions should read from a particular
 * socket before checking if others need reading from.
 */
#define MAX_READS	32


extern void setup_sock_raw(void);
extern void close_sock_raw(void);
extern void setup_game_sockets(struct config_file *);
extern void close_game_sockets(dlink_list game_list);
extern void update_game_sockets(struct config_file *, struct config_file *);
 
extern void read_from_socket(fdext_t *, struct subnet_info *,
		int, struct hashtable *);

#endif
